package com.bsth.entity;

import com.bsth.entity.schedule.BEntity;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.hibernate.annotations.Formula;

import javax.persistence.*;

/**
 * 
 * @ClassName : Personnel(人员实体类)
 * 
 * @Author : bsth@lq
 * 
 * @Description : TODO(人员)
 * 
 * @Data :2016-04-27
 *
 * @Version ﻿公交调度系统BS版 0.1
 * 
 */

@Entity
@Table(name = "bsth_c_personnel")
@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"})
public class Personnel extends BEntity {

    /** 主键Id */
	@Id
	@GeneratedValue
	private Integer id;

    /** 所属公司 */
    @Column(nullable = false)
    private String company;
    /** 公司编码 */
    @Column(nullable = false)
    private String companyCode;
    /** 所属分公司 */
    private String brancheCompany;
    /** 分公司编码 */
    private String brancheCompanyCode;
    /** 组合公司分公司编码 */
    @Formula(" concat(company_code, '_', branche_company_code) ")
    private String cgsbm;

    /** 工号 */
    @Column(nullable = false)
    private String jobCode;
    /** 姓名 */
    @Column(nullable = false)
    private String personnelName;

    /** 运营服务证书号 */
    private String papersCode;
    /** 一卡通工作卡号 */
    private String icCardCode;
    /** 性别（字典类型sexType） */
    private String personnelType;
    /** 所属岗位/工种（字典类型gzType） */
    private String posts;
    
    /** 身份证 */
    private String card;

    public Personnel() {}

    public Personnel(Object id, Object companyCode, Object gh) {
        if (id != null) {
            this.id = Integer.valueOf(id.toString());
        }
        if (companyCode != null) {
            this.companyCode = companyCode.toString();
        }
        if (gh != null) {
            this.jobCode = gh.toString();
        }
    }

	public String getCard() {
		return card;
	}

	public void setCard(String card) {
		this.card = card;
	}

	/** 人员编码（TODO：在原系统里没有，这里暂时留着） */
	private String personnelCode;
	/** 照片地址（TODO：在原系统里没有，这里暂时留着） */
	private String personnelImg;
	/** 线路编号（TODO：在原系统里没有，这里暂时留着） */
	private String lineCode;
	/** 联系电话（TODO：在原系统里没有，这里暂时留着） */
	private String telphone;
    /** 描述（TODO：在原系统里没有，这里暂时留着） */
    private String descriptions;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getCompany() {
        return company;
    }

    public void setCompany(String company) {
        this.company = company;
    }

    public String getCompanyCode() {
        return companyCode;
    }

    public void setCompanyCode(String companyCode) {
        this.companyCode = companyCode;
    }

    public String getBrancheCompany() {
        return brancheCompany;
    }

    public void setBrancheCompany(String brancheCompany) {
        this.brancheCompany = brancheCompany;
    }

    public String getBrancheCompanyCode() {
        return brancheCompanyCode;
    }

    public void setBrancheCompanyCode(String brancheCompanyCode) {
        this.brancheCompanyCode = brancheCompanyCode;
    }

    public String getJobCode() {
        return jobCode;
    }

    public void setJobCode(String jobCode) {
        this.jobCode = jobCode;
    }

    public String getPersonnelName() {
        return personnelName;
    }

    public void setPersonnelName(String personnelName) {
        this.personnelName = personnelName;
    }

    public String getPapersCode() {
        return papersCode;
    }

    public void setPapersCode(String papersCode) {
        this.papersCode = papersCode;
    }

    public String getIcCardCode() {
        return icCardCode;
    }

    public void setIcCardCode(String icCardCode) {
        this.icCardCode = icCardCode;
    }

    public String getPersonnelType() {
        return personnelType;
    }

    public void setPersonnelType(String personnelType) {
        this.personnelType = personnelType;
    }

    public String getPosts() {
        return posts;
    }

    public void setPosts(String posts) {
        this.posts = posts;
    }

    public String getPersonnelCode() {
        return personnelCode;
    }

    public void setPersonnelCode(String personnelCode) {
        this.personnelCode = personnelCode;
    }

    public String getPersonnelImg() {
        return personnelImg;
    }

    public void setPersonnelImg(String personnelImg) {
        this.personnelImg = personnelImg;
    }

    public String getLineCode() {
        return lineCode;
    }

    public void setLineCode(String lineCode) {
        this.lineCode = lineCode;
    }

    public String getTelphone() {
        return telphone;
    }

    public void setTelphone(String telphone) {
        this.telphone = telphone;
    }

    public String getDescriptions() {
        return descriptions;
    }

    public void setDescriptions(String descriptions) {
        this.descriptions = descriptions;
    }

    public String getCgsbm() {
        return cgsbm;
    }

    public void setCgsbm(String cgsbm) {
        this.cgsbm = cgsbm;
    }
}
